package com.ywjt.platformbusiness.my.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.my.model.BalanceModel;

import java.util.List;

public class BalanceAdapter extends BaseQuickAdapter<BalanceModel.ResultDTO.BalanceRecordListDTO, BaseViewHolder> {

    public BalanceAdapter(@Nullable List<BalanceModel.ResultDTO.BalanceRecordListDTO> data) {
        super(R.layout.item_mybalance, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BalanceModel.ResultDTO.BalanceRecordListDTO item) {
        switch (item.getType()){
            case 0:
                helper.setText(R.id.tvTitle,"支付成功");
                helper.setText(R.id.tvCreateTime,"支付时间"+item.getCreateTime());
                helper.setText(R.id.tvIntegral,"-"+item.getAmount());
                break;
            case 1:
                helper.setText(R.id.tvTitle,"提现成功");
                helper.setText(R.id.tvCreateTime,"提现时间"+item.getCreateTime());
                helper.setText(R.id.tvIntegral,"-"+item.getAmount());
                break;
            case 2:
                helper.setText(R.id.tvTitle,"充值成功");
                helper.setText(R.id.tvCreateTime,"充值时间"+item.getCreateTime());
                helper.setText(R.id.tvIntegral,"+"+item.getAmount());
                break;
        }
    }
}